package org.jground.rx.ui.zk.viewControl;

import java.util.ArrayList;
import java.util.Collection;

import org.jground.rx.IRXObject;
import org.jground.rx.RXView;
import org.jground.rx.ui.IMainFrame;
import org.jground.rx.ui.IUIAttributeView;
import org.jground.rx.ui.zk.UIFrame;
import org.jground.zk.zulX.VboxX;
import org.zkoss.zk.ui.Component;

public abstract class UIAttributeViewBase extends VboxX implements IUIAttributeView<Component, UIFrame> {

    protected UIFrame uiFrame;
    protected RXView rxView;
    protected ArrayList<String> renderToStringS = new ArrayList<String>(3);
    //
    private IRXObject contextObject;

    public UIAttributeViewBase(IMainFrame<Component> uiFrame, RXView rxView) {
        this.uiFrame = (UIFrame) uiFrame;
        this.rxView = rxView;
        setWidth("100%");
    }

    public UIAttributeViewBase() {   }

    public void setDataContext(IRXObject moDataObject) {
        this.contextObject = moDataObject;
    }

    public IRXObject getDataContext() {
        return this.contextObject;
    }

    public abstract void set(String... values);

    public abstract void clear();

    public Component getComponent() {
        return this;
    }

    public Collection<String> renderToString() {
        return this.renderToStringS;
    }
}